<template>
  <div class="app-container">
    <el-form :model="weijiFormData" ref="queryForm1">
      <el-row>
        <el-col :span="8">
          <el-form-item label="姓名：" prop="violativeName">
            <el-input style="width:60%" v-model="weijiFormData.violativeName" :disabled="true"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="班级：" prop="violativeClass">
            <el-input style="width:60%" v-model="weijiFormData.violativeClass" :disabled="true"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="违规级别：" prop="violativeLevel">
            <el-select style="width:60%" v-model="weijiFormData.violativeLevel" placeholder="请选择" :disabled="true">
              <el-option v-for="item in gradeOptions" :label="item.dictLabel" :value="item.dictValue" :key="item.id"
                v-model="weijiFormData.violativeLevel" :disabled="true">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-form-item label="标签：" prop="arr">
        <el-checkbox-group v-model="arr">
          <el-checkbox v-for="item in statusOptions" :label="item.dictLabel" :key="item.id" v-model="arr"
            :disabled="true">
          </el-checkbox>
        </el-checkbox-group>
      </el-form-item>
      <el-form-item label="描述：" prop="description">
        <el-input type="textarea" style="width: 89%;" :autosize=" { minRows: 3, maxRows: 6 }"
          v-model="weijiFormData.description" :disabled="true">
        </el-input>
      </el-form-item>
      <el-form-item label="其他附件：" label-width="100px" style="margin-left: -20px" prop="fileList">
        <el-upload style="width: 20%;margin-top: -40px;" class="upload-demo" :on-preview="handlePreview"
          action="http://192.168.0.104:8088/test/uploadImage" :file-list="fileList" :disabled="true">
        </el-upload>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
  export default {
    name: "weijiApplyDetail",
    props: {
      weijiFormData: Object,
      arr: Array,
      fileList: Array,
      gradeOptions: Array,
      statusOptions: Array,
      isShowWeiji: Boolean,
    },
    data () {
      return {
        // upload: {
        //   headers: { Authorization: "Bearer" + getToken() },
        //   url: process.env.VUE_APP_BASE_API + "/test/uploadImage",
        //   baseUri: process.env.VUE_APP_BASE_API
        // }
      };
    },
    computed: {
      getOpen () {
        console.log(this.weijiFormData, 6868686)
        return this.weijiFormData;
      }
    },
    watch: {
      getOpen (val) {
        console.log(val, 6868686)
      }
    },
    created () {
    },
    methods: {
      handlePreview (val) {
        console.log(val, 585)
        if (val) {
          const image = new Image();
          image.src = process.env.VUE_APP_BASE_API + '/school/file/' + val.url;
          const imgWindow = window.open(val);
          imgWindow.document.write(image.outerHTML);
        }
      },
    }
  };
</script>